package processor

const (
	InsertType = "Insert"
	UpdateType = "Update"
	QueryType  = "Query"
	DeleteType = "Delete"
)

var processorMap = map[string][]Processor{
	InsertType: {},
	UpdateType: {},
	QueryType:  {},
	DeleteType: {},
}

// 提供默认的入库加密接口

type EncData interface {
	EncodeObj() any
}
type EncProcessor struct {
}

func (e EncProcessor) Match(obj any) bool {
	_, ok := obj.(EncData)
	return ok
}
func (e EncProcessor) Process(obj any) any {
	return obj.(EncData).EncodeObj()
}

// 提供默认的 出库解密接口

type DecData interface {
	DecodeObj() any
}
type DecProcessor struct {
}

func (d DecProcessor) Match(obj any) bool {
	_, ok := obj.(DecData)
	return ok
}

func (d DecProcessor) Process(obj any) any {
	return obj.(DecData).DecodeObj()
}
